#!/usr/bin/python2.4
#
# Copyright 2011 Google Inc. All Rights Reserved.

"""One-line documentation for clean module.

A detailed description of clean.
"""

__author__ = 'arb@google.com (Anthony Baxter)'

from controllers.query import CachedData, CachedData2
from google.appengine.ext import webapp
import wsgiref.handlers

def nuke():
  for i in range(10):
    for item in CachedData2.all().fetch(100):
      item.delete()
    print "deleted %s"%(i*100)

class NukeHandler(webapp.RequestHandler):
  """Edit existing/broken records."""

  def get(self):
    nuke()

def main():
  app = webapp.WSGIApplication([
      ('/geocode__/clean', NukeHandler),
      ], debug=True)
  wsgiref.handlers.CGIHandler().run(app)

if __name__ == '__main__':
  main()
